package bitwiseOperation;

//https://leetcode.cn/problems/hamming-distance/description/
public class l_461 {
    public int hammingDistance(int x, int y) {
        int ans = 0, num = x ^ y;
        while(num != 0)
        {
            num = num & (num - 1);
            ans++;
        }
        return ans;
    }
}
